package com.xiguaji.tiktok.v1.ins.blogger.repository;

import com.xiguaji.tiktok.v1.ins.blogger.model.InsMarkBloggerDay;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 * 播主打点信息
 * @author Huangixn
 */
public interface InsMarkBloggerDayRepository extends CrudRepository<InsMarkBloggerDay,Integer> {

    /**
     * 根据时间及uid获取近30天打点数据
     * @param dateCode
     * @param uid
     * @return
     */
    @Query("select id,uid,datecode,follower_count,follower_grow,media_count,media_grow,last_follower_grow," +
            " last_follower_grow_rate,last_week_follower_grow from ins_mark_blogger_day " +
            " where datecode >= :dateCode and uid = :uid " +
            " order by datecode")
    List<InsMarkBloggerDay> findMarkInfoByDateCodeAndUid(int dateCode,long uid);
}
